Skip to main content

OrmLiteCacheClient<TCacheEntry>

Assembly: ServiceStack.Server.dll
View Source
Declaration
public class OrmLiteCacheClient<TCacheEntry> : object, ICacheClientAsync, IRemoveByPatternAsync, IRequiresSchema, ICacheClientExtended, ICacheClient, IRemoveByPattern where TCacheEntry : ICacheEntry, new()

Properties

DbFactory

View Source
Declaration
public IDbConnectionFactory DbFactory { get; set; }

Methods

ExecAsync<T>(Func<IDbConnection, Task<T>>, CancellationToken)

View Source
Declaration
public async Task<T> ExecAsync<T>(Func<IDbConnection, Task<T>> action, CancellationToken token = null)
Returns

Task<<T>>

Parameters
TypeName
Func<IDbConnection,Task<<T>>>action
CancellationTokentoken
Type Parameters
  • T

ExecAsync(Func<IDbConnection, Task>, CancellationToken)

View Source
Declaration
public async Task ExecAsync(Func<IDbConnection, Task> action, CancellationToken token = null)
Returns

Task

Parameters
TypeName
Func<IDbConnection,Task>action
CancellationTokentoken

RemoveAsync(String, CancellationToken)

View Source
Declaration
public async Task<bool> RemoveAsync(string key, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.Stringkey
CancellationTokentoken

RemoveAllAsync(IEnumerable<String>, CancellationToken)

View Source
Declaration
public async Task RemoveAllAsync(IEnumerable<string> keys, CancellationToken token = null)
Returns

Task

Parameters
TypeName
IEnumerable<System.String>keys
CancellationTokentoken

GetAsync<T>(String, CancellationToken)

View Source
Declaration
public async Task<T> GetAsync<T>(string key, CancellationToken token = null)
Returns

Task<<T>>

Parameters
TypeName
System.Stringkey
CancellationTokentoken
Type Parameters
  • T

IncrementAsync(String, UInt32, CancellationToken)

View Source
Declaration
public async Task<long> IncrementAsync(string key, uint amount, CancellationToken token = null)
Returns

Task<System.Int64>

Parameters
TypeName
System.Stringkey
System.UInt32amount
CancellationTokentoken

DecrementAsync(String, UInt32, CancellationToken)

View Source
Declaration
public async Task<long> DecrementAsync(string key, uint amount, CancellationToken token = null)
Returns

Task<System.Int64>

Parameters
TypeName
System.Stringkey
System.UInt32amount
CancellationTokentoken

AddAsync<T>(String, T, CancellationToken)

View Source
Declaration
public async Task<bool> AddAsync<T>(string key, T value, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
CancellationTokentoken
Type Parameters
  • T

SetAsync<T>(String, T, CancellationToken)

View Source
Declaration
public async Task<bool> SetAsync<T>(string key, T value, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
CancellationTokentoken
Type Parameters
  • T

ReplaceAsync<T>(String, T, CancellationToken)

View Source
Declaration
public async Task<bool> ReplaceAsync<T>(string key, T value, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
CancellationTokentoken
Type Parameters
  • T

AddAsync<T>(String, T, DateTime, CancellationToken)

View Source
Declaration
public async Task<bool> AddAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
DateTimeexpiresAt
CancellationTokentoken
Type Parameters
  • T

SetAsync<T>(String, T, DateTime, CancellationToken)

View Source
Declaration
public async Task<bool> SetAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
DateTimeexpiresAt
CancellationTokentoken
Type Parameters
  • T

ReplaceAsync<T>(String, T, DateTime, CancellationToken)

View Source
Declaration
public async Task<bool> ReplaceAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
DateTimeexpiresAt
CancellationTokentoken
Type Parameters
  • T

AddAsync<T>(String, T, TimeSpan, CancellationToken)

View Source
Declaration
public async Task<bool> AddAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
TimeSpanexpiresIn
CancellationTokentoken
Type Parameters
  • T

SetAsync<T>(String, T, TimeSpan, CancellationToken)

View Source
Declaration
public async Task<bool> SetAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
TimeSpanexpiresIn
CancellationTokentoken
Type Parameters
  • T

ReplaceAsync<T>(String, T, TimeSpan, CancellationToken)

View Source
Declaration
public async Task<bool> ReplaceAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.Stringkey
<T>value
TimeSpanexpiresIn
CancellationTokentoken
Type Parameters
  • T

FlushAllAsync(CancellationToken)

View Source
Declaration
public async Task FlushAllAsync(CancellationToken token = null)
Returns

Task

Parameters
TypeName
CancellationTokentoken

GetAllAsync<T>(IEnumerable<String>, CancellationToken)

View Source
Declaration
public async Task<IDictionary<string, T>> GetAllAsync<T>(IEnumerable<string> keys, CancellationToken token = null)
Returns

Task<IDictionary<System.String,<T>>>

Parameters
TypeName
IEnumerable<System.String>keys
CancellationTokentoken
Type Parameters
  • T

SetAllAsync<T>(IDictionary<String, T>, CancellationToken)

View Source
Declaration
public async Task SetAllAsync<T>(IDictionary<string, T> values, CancellationToken token = null)
Returns

Task

Parameters
TypeName
IDictionary<System.String,<T>>values
CancellationTokentoken
Type Parameters
  • T

GetTimeToLiveAsync(String, CancellationToken)

View Source
Declaration
public async Task<TimeSpan?> GetTimeToLiveAsync(string key, CancellationToken token = null)
Returns

Task<System.Nullable<TimeSpan>>

Parameters
TypeName
System.Stringkey
CancellationTokentoken

RemoveByPatternAsync(String, CancellationToken)

View Source
Declaration
public async Task RemoveByPatternAsync(string pattern, CancellationToken token = null)
Returns

Task

Parameters
TypeName
System.Stringpattern
CancellationTokentoken

GetKeysByPatternAsync(String, CancellationToken)

View Source
Declaration
public async IAsyncEnumerable<string> GetKeysByPatternAsync(string pattern, CancellationToken token = null)
Returns

IAsyncEnumerable<System.String>

Parameters
TypeName
System.Stringpattern
CancellationTokentoken

DisposeAsync()

View Source
Declaration
public ValueTask DisposeAsync()
Returns

ValueTask

RemoveExpiredEntriesAsync(CancellationToken)

View Source
Declaration
public async Task RemoveExpiredEntriesAsync(CancellationToken token = null)
Returns

Task

Parameters
TypeName
CancellationTokentoken

RemoveByRegexAsync(String, CancellationToken)

View Source
Declaration
public Task RemoveByRegexAsync(string regex, CancellationToken token = null)
Returns

Task

Parameters
TypeName
System.Stringregex
CancellationTokentoken

Exec<T>(Func<IDbConnection, T>)

View Source
Declaration
public T Exec<T>(Func<IDbConnection, T> action)
Returns

<T>

Parameters
TypeName
Func<IDbConnection,<T>>action
Type Parameters
  • T

Exec(Action<IDbConnection>)

View Source
Declaration
public void Exec(Action<IDbConnection> action)
Parameters
TypeName
Action<IDbConnection>action

Remove(String)

View Source
Declaration
public bool Remove(string key)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey

RemoveAll(IEnumerable<String>)

View Source
Declaration
public void RemoveAll(IEnumerable<string> keys)
Parameters
TypeName
IEnumerable<System.String>keys

Get<T>(String)

View Source
Declaration
public T Get<T>(string key)
Returns

<T>

Parameters
TypeName
System.Stringkey
Type Parameters
  • T

Increment(String, UInt32)

View Source
Declaration
public long Increment(string key, uint amount)
Returns

System.Int64

Parameters
TypeName
System.Stringkey
System.UInt32amount

Decrement(String, UInt32)

View Source
Declaration
public long Decrement(string key, uint amount)
Returns

System.Int64

Parameters
TypeName
System.Stringkey
System.UInt32amount

Add<T>(String, T)

View Source
Declaration
public bool Add<T>(string key, T value)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
Type Parameters
  • T

Set<T>(String, T)

View Source
Declaration
public bool Set<T>(string key, T value)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
Type Parameters
  • T

Replace<T>(String, T)

View Source
Declaration
public bool Replace<T>(string key, T value)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
Type Parameters
  • T

Add<T>(String, T, DateTime)

View Source
Declaration
public bool Add<T>(string key, T value, DateTime expiresAt)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
DateTimeexpiresAt
Type Parameters
  • T

Set<T>(String, T, DateTime)

View Source
Declaration
public bool Set<T>(string key, T value, DateTime expiresAt)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
DateTimeexpiresAt
Type Parameters
  • T

Replace<T>(String, T, DateTime)

View Source
Declaration
public bool Replace<T>(string key, T value, DateTime expiresAt)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
DateTimeexpiresAt
Type Parameters
  • T

Add<T>(String, T, TimeSpan)

View Source
Declaration
public bool Add<T>(string key, T value, TimeSpan expiresIn)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
TimeSpanexpiresIn
Type Parameters
  • T

Set<T>(String, T, TimeSpan)

View Source
Declaration
public bool Set<T>(string key, T value, TimeSpan expiresIn)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
TimeSpanexpiresIn
Type Parameters
  • T

Replace<T>(String, T, TimeSpan)

View Source
Declaration
public bool Replace<T>(string key, T value, TimeSpan expiresIn)
Returns

System.Boolean

Parameters
TypeName
System.Stringkey
<T>value
TimeSpanexpiresIn
Type Parameters
  • T

FlushAll()

View Source
Declaration
public void FlushAll()

GetAll<T>(IEnumerable<String>)

View Source
Declaration
public IDictionary<string, T> GetAll<T>(IEnumerable<string> keys)
Returns

IDictionary<System.String,<T>>

Parameters
TypeName
IEnumerable<System.String>keys
Type Parameters
  • T

SetAll<T>(IDictionary<String, T>)

View Source
Declaration
public void SetAll<T>(IDictionary<string, T> values)
Parameters
TypeName
IDictionary<System.String,<T>>values
Type Parameters
  • T

InitSchema()

View Source
Declaration
public void InitSchema()

Verify(IDbConnection, IEnumerable<TCacheEntry>)

View Source
Declaration
public List<TCacheEntry> Verify(IDbConnection db, IEnumerable<TCacheEntry> entries)
Returns

List<<TCacheEntry>>

Parameters
TypeName
IDbConnectiondb
IEnumerable<<TCacheEntry>>entries

Verify(IDbConnection, TCacheEntry)

View Source
Declaration
public TCacheEntry Verify(IDbConnection db, TCacheEntry entry)
Returns

<TCacheEntry>

Parameters
TypeName
IDbConnectiondb
<TCacheEntry>entry

GetTimeToLive(String)

View Source
Declaration
public TimeSpan? GetTimeToLive(string key)
Returns

System.Nullable<TimeSpan>

Parameters
TypeName
System.Stringkey

RemoveByPattern(String)

View Source
Declaration
public void RemoveByPattern(string pattern)
Parameters
TypeName
System.Stringpattern

GetKeysByPattern(String)

View Source
Declaration
public IEnumerable<string> GetKeysByPattern(string pattern)
Returns

IEnumerable<System.String>

Parameters
TypeName
System.Stringpattern

RemoveExpiredEntries()

View Source
Declaration
public void RemoveExpiredEntries()

RemoveByRegex(String)

View Source
Declaration
public void RemoveByRegex(string regex)
Parameters
TypeName
System.Stringregex

Dispose()

View Source
Declaration
public void Dispose()

Implements